// Jordan Wages
// David Watkins
// Programming Project 3
// Time Implementation

#include "Time.h"
#include <iostream>
//#include <sstream>
using namespace std;

Time::Time(){
             seconds = minutes = hours = 0;
}

Time::Time(int sec){
               seconds = sec;
               hours = (seconds / (60*60));
               seconds -= hours*60*60;
               minutes = (seconds / 60);
               seconds -= minutes*60;
}

Time::Time(int min, int sec){
               seconds = ((min*60) + sec);
               hours = (seconds / (60*60));
               seconds -= hours*60*60;
               minutes = (seconds / 60);
               seconds -= minutes*60;
}

Time::Time(int h, int min, int sec){
               seconds = ((h*60*60) + (min*60) + sec);
               hours = (seconds / (60*60));
               seconds -= hours*60*60;
               minutes = (seconds / 60);
               seconds -= minutes*60;
}

int Time::round2minutes(int sec){
    minutes = sec / 60;
    if(sec % 60 != 0)
           minutes += 1;
}

int Time::round2minutes(int min, int sec){
    minutes += sec / 60;
    if(sec % 60 != 0)
           minutes += 1;
}

int Time::round2minutes(int h, int min, int sec){
    minutes += (sec / 60) + hours * 60;
    if(sec % 60 != 0)
           minutes += 1;
}

void Time::dispTime(){
     cout << hours << ":" << minutes << ":" << seconds;
}
